package com.hjq.demo.yuliao.activity

import com.hjq.demo.R
import com.hjq.demo.app.vb.AppVbActivity
import com.hjq.demo.databinding.ActivityMyConversationBinding
import io.rong.imkit.conversation.ConversationFragment
import io.rong.imkit.userinfo.RongUserInfoManager

/**
 *
 * @author jiahe
 * 创建日期 2022/2/15
 * 描述 继承自己的会话
 *
 */
class MyConversationActivity : AppVbActivity<ActivityMyConversationBinding>() {

    override fun initView() {
        // 添加会话界面
        val conversationFragment = ConversationFragment()
        val manager = supportFragmentManager
        val transaction = manager.beginTransaction()
        transaction.replace(R.id.container, conversationFragment)
        transaction.commit()

        val userInfo = RongUserInfoManager.getInstance().getUserInfo(intent.getStringExtra("targetId"))
        binding.tbTitle.title = if (userInfo == null) intent.getStringExtra("targetId") else userInfo.name
    }

    override fun initData() {

    }
}